package com.crm.business.crm.mapper;


import com.crm.common.crm.entity.BO.CrmSourceSearchBO;
import com.crm.common.crm.entity.PO.CrmSource;
import com.crm.business.servlet.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 大小类关联 Mapper 接口
 * </p>
 *
 * @author zhangzhiwei
 * @since 2020-05-21
 */
public interface CrmSourceMapper extends BaseMapper<CrmSource> {

    /**
     * 获取大小类关联数据
     * @return
     */
    List<CrmSource> queryList(@Param("data") CrmSourceSearchBO crmSource);

    Integer queryListCount(@Param("data") CrmSourceSearchBO crmSource);

    /**
     * 根据分组获取数据信息
     * @param sourceGroup
     * @return
     */
    List<CrmSource> queryListBySourceGroup(@Param("sourceGroup") Integer sourceGroup);

    /**
     * 根据code编码获取数据
     * @param categoryCode
     * @return
     */
    List<CrmSource> queryListByCategoryCode(@Param("categoryCode") Integer categoryCode);

    /**
     * 根据客户来源查询大类信息
     * @param source
     * @return
     */
    CrmSource queryCategoryDataBySource(@Param("source") String source);

    /**
     * 获取大类信息
     * @return
     */
    List<CrmSource> queryCategoryDataByGroup();

    List<CrmSource> querySourceDataGroupByCode();

    int addSource(@Param("data") CrmSource source);

    int updateSource(@Param("data") CrmSource source);

    List<CrmSource> querySourceByIds(@Param("data") List<Integer> ids);

    CrmSource queryInfoById(@Param("id") Integer id);

    int deleteSourcesByIds(@Param("data") List<Integer> ids);

    int deleteSourceById(@Param("id") Integer ids);

}
